﻿using System;
using Jayden.Dll.Web.Enums;
using Jayden.Dll.Web.Helper;
using Jayden.Dll.Web.HtmlControls.Descriptions;
using Jayden.Dll.Web.HtmlControls.Generics;

namespace Jayden.Dll.Web.HtmlControls
{
	public class Meter : HtmlElement
	{
		public Meter() : base(MeterDescription.Instance) { }

		public double? Value { get { return HtmlHelper.FromHtmlFloat(this["value"]); } set { this["value"] = HtmlHelper.ToHtmlFloat(value); } }
		public double? Min { get { return HtmlHelper.FromHtmlFloat(this["min"]); } set { this["min"] = HtmlHelper.ToHtmlFloat(value); } }
		public double? Low { get { return HtmlHelper.FromHtmlFloat(this["low"]); } set { this["low"] = HtmlHelper.ToHtmlFloat(value); } }
		public double? High { get { return HtmlHelper.FromHtmlFloat(this["high"]); } set { this["high"] = HtmlHelper.ToHtmlFloat(value); } }
		public double? Max { get { return HtmlHelper.FromHtmlFloat(this["max"]); } set { this["max"] = HtmlHelper.ToHtmlFloat(value); } }
		public double? Optimum { get { return HtmlHelper.FromHtmlFloat(this["optimum"]); } set { this["optimum"] = HtmlHelper.ToHtmlFloat(value); } }
	}
	public class MeterDescription : HtmlElementDescription
	{
		public static readonly MeterDescription Instance = new MeterDescription();
		private MeterDescription() : base("meter", HtmlVersion.Html5) { }
		public override Type ControlType { get { return typeof(Meter); } }
	}
}
